load("@bazeldnf//bazeldnf:defs.bzl", "bazeldnf", "rpmtree", "tar2files")
load("@rules_cc//cc:defs.bzl", "cc_library")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")

bazeldnf(
    name = "bazeldnf",
)

rpmtree(
    name = "something",
    rpms = [
        "@libvirt-libs-11.0.0-1.fc42.x86_64.rpm//rpm",
        "@libvirt-devel-11.0.0-1.fc42.x86_64.rpm//rpm",
    ],
)

tar2files(
    name = "something_libs",
    files = {
        "/usr/lib64": [
            "libvirt.so.0",
            "libvirt.so.0.11000.0",
        ],
    },
    tar = ":something",
    visibility = ["//visibility:public"],
)

pkg_tar(
    name = "whatever",
    deps = [":something"],
)

cc_library(
    name = "bar",
    srcs = ["//:something_libs/usr/lib64"],
)

sh_binary(
    name = "run-wrapper",
    srcs = ["run-wrapper.sh"],
    data = [":bazeldnf"],
    env = {
        "BAZELDNF_PATH": "$(location :bazeldnf)",
    },
)
